﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    /// <summary>
    /// 角色权限实体
    /// </summary>
    [Serializable]
    public class Sys_RoleOperate : Entity
    {
        /// <summary>
        /// 角色权限实体
        /// </summary>
        public Sys_RoleOperate()
            : base("Sys_RoleOperate")
        {
        }

        #region Fire.Model
        private string _RoleID;
        private string _ModuleID;
        private string _OperateID;
        /// <summary>
        /// 角色ID
        /// </summary>
        public string RoleID
        {
            get { return _RoleID; }
            set
            {
                this.OnPropertyValueChange(_.RoleID, _RoleID, value);
                this._RoleID = value;
            }
        }
        /// <summary>
        /// 模块ID
        /// </summary>
        public string ModuleID
        {
            get { return _ModuleID; }
            set
            {
                this.OnPropertyValueChange(_.ModuleID, _ModuleID, value);
                this._ModuleID = value;
            }
        }
        /// <summary>
        /// 功能点ID
        /// </summary>
        public string OperateID
        {
            get { return _OperateID; }
            set
            {
                this.OnPropertyValueChange(_.OperateID, _OperateID, value);
                this._OperateID = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.RoleID,
				_.ModuleID,
				_.OperateID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.RoleID,
				_.ModuleID,
				_.OperateID};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._RoleID,
				this._ModuleID,
				this._OperateID};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._RoleID = DataUtils.ConvertValue<string>(reader["RoleID"]);
            this._ModuleID = DataUtils.ConvertValue<string>(reader["ModuleID"]);
            this._OperateID = DataUtils.ConvertValue<string>(reader["OperateID"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._RoleID = DataUtils.ConvertValue<string>(row["RoleID"]);
            this._ModuleID = DataUtils.ConvertValue<string>(row["ModuleID"]);
            this._OperateID = DataUtils.ConvertValue<string>(row["OperateID"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Sys_RoleOperate");
            /// <summary>
            /// 角色ID
            /// </summary>
            public readonly static Field RoleID = new Field("RoleID", "Sys_RoleOperate", "角色ID");
            /// <summary>
            /// 模块ID
            /// </summary>
            public readonly static Field ModuleID = new Field("ModuleID", "Sys_RoleOperate", "模块ID");
            /// <summary>
            /// 功能点ID
            /// </summary>
            public readonly static Field OperateID = new Field("OperateID", "Sys_RoleOperate", "功能点ID");
        }
        #endregion


    }
}

